/*
 * messaging_pipe.h
 *
 *  Created on: 20 Oca 2012
 *      Author: root
 */

#ifndef MESSAGING_PIPE_H_
#define MESSAGING_PIPE_H_

#include <unistd.h>
#include <errno.h>
#include <deque>

#include "messaging_abstract.h"

namespace androidplus {
namespace messaging{

class messaging_pipe:public virtual messaging_abstract {
public:
	messaging_pipe();
	virtual ~messaging_pipe();
	int write_message(const message* msg)throw();
	int read_message(message** msg)throw();
	virtual int fd()const;
private:
	int channel_read;
	int channel_write;
	std::deque< message *> queue;
};
}
} /* namespace AndroidPlus */
#endif /* MESSAGING_PIPE_H_ */
